# Maintainer: AndyRTR <andyrtr@archlinux.org>
# Contributor: Thomas Arnhold <thomas at arnhold dot org>

pkgname=libe-book
pkgver=0.1.3
pkgrel=14
pkgdesc="Library for import of reflowable e-book formats."
arch=('loong64' 'x86_64')
url="https://sourceforge.net/projects/libebook/"
license=('LGPL2.1' 'MPL')
depends=('librevenge' 'libxml2' 'liblangtag')
makedepends=('gperf' 'boost' 'cppunit' 'doxygen')
source=(https://sourceforge.net/projects/${pkgname//-/}/files//${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.xz
        icu68.patch)
sha1sums=('18fde9588c236d51eea9437ed882d8b751daf01f'
          '132fd6bf8622f2d922a9e844c665a906d6b2bbdb')
sha256sums=('7e8d8ff34f27831aca3bc6f9cc532c2f90d2057c778963b884ff3d1e34dfe1f9'
            '33953b0430e5f80ac75fc80270ef9b52f996632bc8ee30d8c88999658beb056e')

prepare() {
  cd "${pkgname}"-${pkgver}
  patch -Np0 -i ../icu68.patch
}

build() {
  cd "${pkgname}"-${pkgver}
  ./configure --prefix=/usr
  make
}

check() {
  cd "${pkgname}"-${pkgver}
  make check
}

package() {
  cd "${pkgname}"-${pkgver}
  make DESTDIR="$pkgdir" install
}
